<#import "/analysis/function.ftl" as fn>
<@fn.header _title="核对家庭统计">
<@fn.getStreet />
</@fn.header>
<body>
<@fn.position _value="当前位置 &gt;&gt; 核对业务统计 &gt; 核对家庭统计" />
<div class="contentDiv">
  <div class="condition">
    <h2>统计条件</h2>
    <form id="listForm" method="post">
	    <table class="tableStyle">
	      <tr>
	        <td width="11%">受理时间段：</td>
	        <td width="22%"><input name="acceptStartTime" type="text" class="btnTxtDate" id="textfield" onClick="WdatePicker()" />
	          至
	          <input name="acceptEndTime" type="text" class="btnTxtDate" id="textfield13" onClick="WdatePicker()" />
	          </td>
	        <td width="10%">所属区县：</td>
	        <td width="24%"><select name="countiesRegionId" class="btnSelect" id="country" onchange="getStreet(this.value)">
	            <option value="">-- 请选择 --</option>
				<#if countryRegionList??>
					<#list countryRegionList as region>
					  <option value="${region.id}">${region.name}</option>
					</#list>
				</#if>
	          </select>
	          </td>
	        <td width="11%">所属街道：</td>
	        <td width="22%"><select name="streetRegionId" class="btnSelect" id="street">
	            <option value="">-- 请选择 --</option>
	          </select></td>
	      </tr>
	    </table>
	    <table class="buttonT">
	      <tr>
	        <td width="10%"><input type="submit" class="button" value="统 计" /></td>
	      </tr>
	    </table>
    </form>
  </div>
  <div class="reasult">
    <h2>统计结果</h2>
    <form id="exportExcel" action="${base}/checkBusinessStat/exportExcel" method="post">
    <table class="gridStyle">
      <tr>
        <th>区县</th>
        <th>街道</th>
        <th>核对家庭户数</th>
        <th>核对家庭人数</th>
      </tr>
      <#assign totalFamilyNum=0 />
      <#assign totalPersonNum=0 />
      <#list resultList as data>
      		<#assign totalFamilyNum=totalFamilyNum+data.streetFamilyStatDataList[0].familyNum />
      		<#assign totalPersonNum=totalPersonNum+data.streetFamilyStatDataList[0].personNum />
	      <tr>
	        <td<#if (data.streetFamilyStatDataList?size>1)> rowspan="${data.streetFamilyStatDataList?size}"</#if>>${data.countryRegionName}</td>
	        <td>${data.streetFamilyStatDataList[0].streetName}</td>
	        <td>${data.streetFamilyStatDataList[0].familyNum}</td>
	        <td>${data.streetFamilyStatDataList[0].personNum}</td>
	      </tr>
	      <#if (data.streetFamilyStatDataList?size>1)>
		      <#list data.streetFamilyStatDataList[1..] as _data>
		      <#assign totalFamilyNum=totalFamilyNum+_data.familyNum />
		      <#assign totalPersonNum=totalPersonNum+_data.personNum />
			      <tr>
			        <td>${_data.streetName}</td>
			        <td>${_data.familyNum}</td>
			        <td>${_data.personNum}</td>
			      </tr>
		      </#list>
	      </#if>
      </#list>
	      <tr>
	        <td colspan="2">合计</td>
	        <td><input type="hidden" name="totalFamilyNum" value='${totalFamilyNum}'/>${totalFamilyNum}</td>
	        <td><input type="hidden" name="totalPersonNum" value='${totalPersonNum}'/>${totalPersonNum}</td>
	      </tr>
    </table>
    <table class="buttonT">
      <tr>
        <td width="10%"><input type="submit" class="button" value="导出Excel" /></td>
      </tr>
    </table>
    </form>
  </div>
  <div class="explain">
    <h3>说明：</h3>
    <p>1. 未选择统计条件的情况下，默认登陆用户权限下“开始至今”所有数据的统计。</p>
    <p>2. 统计表可下载（excel)、打印。</p>
  </div>
</div>
</body>
</html>
